﻿using Deixei.Domain;
using Deixei.Web.Controllers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Deixei.WebApplication.Api
{
    public class CustomerServiceController : DeixeiDataController
    {
        // http://www.bluebasher.com/post/2012/05/15/Building-a-Single-Page-Application-without-Entity-Framework.aspx

        public IEnumerable<Customer> GetCustomers()
        {
            IEnumerable<Customer> result;

            result = ApplicationContext.ServiceLayerContext.CustomerService.GetAllCustomers();
            
            return result;
        }


        [HttpPost]
        public Customer AddCustomers(Customer customer)
        {
            Customer result;

            result = ApplicationContext.ServiceLayerContext.CustomerService.AddCustomer(customer);

            return result;
        }


    }
}
